<%-- 
    Document   : actiontotalTour
    Created on : Nov 14, 2012, 5:23:11 PM
    Author     : Nguyen Hung
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <script type="text/javascript" language="javascript">
        var open_cur = 0;
        $j = jQuery.noConflict();
        $j(document).ready(function(){
            $j(".abcdelete" ).click(function() {
                $j(this).parent().parent().parent().parent().hide();
                     
            });
        });
         function countChar(val) {
                var len =  val.value.length;
                
               
                if (len <= 320 && len >= 0) {
                    
                    var i = 320 - len;  
                   
                    $j('.sgt_sms_warming').text("Còn "+i+" kí tự"); 
                    $j('.sms_alert').addClass("displaynone")  
                    $j('.hiddenSend').removeClass("displaynone");
//                     alert(i);
                }else {
                    $j('.sms_alert').removeClass("displaynone")  
                    $j('.hiddenSend').addClass("displaynone");
                }
            };
    </script>
    <style>
        .sms_alert{
            color: red;
            width: 100%;
            text-align: center;
            float: left;
           
           
        }
        .displaynone{
            display:none; 
                
        }
    </style>
    <body>
        <f:view>
            <a4j:form>
                <h:panelGroup id="abcd">
                    <div class="inputSMS">
                        <h:outputText style="float:left;width:97%;" value="SỐ NGƯỜI GỬI : #{templateController.numberSMS}"/>
                        <h:graphicImage style="float:left;width:3%;" styleClass="abcdelete" value="../images/delete_1.png"/>
                    </div>
                </h:panelGroup>
                
                <div class="inputSMS">
                    <div style="width: 20%;text-align: right;float: left;"><h:outputText value="Thông tin gửi SMS :"/></div>
                    <div style="width: 80%;text-align: left;float: left;"><h:inputText style="width:87.5%;" value="#{templateController.cv052}"/></div>
                </div>
                <div class="inputSMS">
                   <div style="width: 100%;text-align: center;float: left;color: yellow;"><h:outputText value="Luu ý chỉ được chỉnh sửa {P3},{P4} và {P5}.Nếu sai nhân viên chịu trách nhiệm!!"/></div>
                </div>
                <div class="inputSMS1">
                    <div style="width: 20%;text-align: right;float: left;"><h:outputText value="Nội dung :"/>
                     <h:outputText id="sgt_sms_warming" styleClass="sgt_sms_warming"  value="Còn #{templateController.countchar} kí tự"/>                                   </div>
                    <div style="width:80%;text-align: left;float: left;"><h:inputTextarea onkeyup="countChar(this)"  style="width:100%;height:100px;" styleClass="" value="#{templateController.cv051}"/></div>
                </div>
                <div class="inputSMS">
                    <a4j:commandButton style="float:right;" value="SEND" reRender="reload4" actionListener="#{templateController.saveTemplateSMSTour}"/>                             

                </div>

            </a4j:form>
        </f:view>

    </body>
</html>
